/* 
 * created by songpeng on 2019-02-23
 */
$(document).ready(function () {
    // 初始化swiper
    var swiper = new Swiper('.swiper1', {
        pagination: {
            el: '.swiper-pagination',
        },
        autoplay: {
            delay: 5000,
            stopOnLastSlide: false,
            disableOnInteraction: true,
        },
        loop: true,
    });
    var swiper1 = new Swiper('.swiper2', {
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },
        autoplay: {
            delay: 5000,
            stopOnLastSlide: false,
            disableOnInteraction: true,
        },
        loop: true,
    });
    $("ul.recommend_ul li a").click(function() {
        if (
          location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") &&
          location.hostname == this.hostname
        ) {
          var $target = $(this.hash);
          $target =
            ($target.length && $target) || $("[name=" + this.hash.slice(1) + "]");
          if ($target.length) {
            var targetOffset = $target.offset().top;
            $("html,body").animate(
              {
                scrollTop: targetOffset
              },
              500
            );
            return false;
          }
        }
      });
})